<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 <head>

  <title>CSS Test: :focus pseudo-class - adjacent sibling selector</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <link rel="help" href="http://www.w3.org/TR/html4/interact/forms.html#h-17.11" />
  <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes" />
  <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#adjacent-selectors" />
  <link rel="bookmark" href="http://www.w3.org/TR/2008/NOTE-WCAG20-TECHS-20081211/C15.html#C15-examples" />
  <meta name="flags" content="interact" />
  <meta name="assert" content="An HTML 4 radio button must receive focus state when clicking on it or when selecting it with the keyboard. The :focus pseudo-class applies to a radio button while it has the focus (accepts keyboard events or other forms of input)." />

  <style type="text/css"><![CDATA[
  input[type="radio"]
  {
  height: 20px;
  width: 60px;
  }

  input[type="radio"]:focus + label
  {
  background-color: yellow;
  color: black;
  }
  ]]></style>

 </head>

 <body>

   <p>With the pointing device (like a mouse left-button click) or with the keyboard (with the tab key or with the "T" accesskey), activate the radio button below. The words "Text sample" on its right-hand side should then have become highlighted in yellow. In order to pass this test, the tester should not have to move the pointing device out of the radio button in order to see the yellow highlighting.</p>

   <div>
    <input type="radio" id="test" accesskey="T" /> <label for="test">Text sample</label>
   </div>

 </body>
</html>